package net.ifilm.service;


import net.ifilm.dao.SlideFilmDao;
import net.ifilm.entity.PageCount;
import net.ifilm.entity.SlideFilm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 *
 */
@Component
public class SlideFilmService {

    @Autowired
    private SlideFilmDao slideFilmDao;

    // ------------------------------------------------------------------------------------------------ public method


    /**
     * 查询轮播电影表
     *
     * @param pageCount
     * @return
     */
    public List<SlideFilm> findSlideFilm(PageCount pageCount) {
        return slideFilmDao.querySlideFilm(pageCount);
    }

    /**
     * 查询轮播电影总数
     *
     * @return
     */
    public int findSlideFilmCount() {
        return slideFilmDao.querySlideFilmCount();
    }

    /**
     * 插入一条轮播电影
     *
     * @param slideFilm
     */
    public void addSlideFilm(SlideFilm slideFilm) {
        slideFilmDao.insertSlideFilm(slideFilm);
    }

    /**
     * 根据ID删除轮播电影纪录
     *
     * @param filmId
     */
    public void delSlideFilmById(int filmId) {
        slideFilmDao.deleteSlideFilmById(filmId);
    }

    /**
     * 更新轮播电影状态
     *
     */
    public void updSlideFilmById(Map<String, Object> parameter) {
        slideFilmDao.updateSlideFilmById(parameter);
    }

} ///:~
